#ifndef COMMON_H
#define COMMON_H

#include <iostream>
#include <fstream>
#include <iomanip>

#define OUTPUTTOFILE(filename, message) \
    {                                   \
        std::ofstream myfile;                \
        myfile.open(filename,std::ofstream::app);          \
        myfile << message << std::endl; \
        myfile.close();                 \
    } 

#define OUTPUTARRAYTOFILE(filename, arrayname, array, ARRAYSIZE ) \
    {                                       \
        std::ofstream myfile;               \
        myfile.open(filename, std::ofstream::app);   \
        myfile << std::setw(16) << arrayname << " :" ;        \
        for(size_t i = 0; i < ARRAYSIZE; i++)     \
            myfile <<std::setw(12) << array[i] <<" ";        \
        myfile<<std::endl;                          \
        myfile.close();                     \
    }


#endif // COMMON_H